-
Notifications
You must be signed in to change notification settings - Fork 873
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevent http.url containing credentials in HttpClientTracer #2707
Conversation
|
...entation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/HttpClientTracer.java
Outdated
Show resolved
Hide resolved
fix inconsistency in protocol
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also have a few more usages of this attribute: HttpAttributesExtractor
from the instrumenter API (should #url()
return URI
? I think it should), the HttpServerTracer
, apache-camel
and aws-lambda
instrumentations.
Can you fix all of them? Thanks!
...entation-api/src/main/java/io/opentelemetry/instrumentation/api/tracer/HttpClientTracer.java
Outdated
Show resolved
Hide resolved
setter.setAttribute( | ||
SemanticAttributes.HTTP_URL, | ||
new URI( | ||
url.getScheme(), | ||
null, | ||
url.getHost(), | ||
url.getPort(), | ||
url.getPath(), | ||
url.getQuery(), | ||
url.getFragment()) | ||
.toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @Hangzhi! I think it would be a worthwhile optimization here to only create a new URI object when the existing URI has user-info
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Hangzhi, are you willing to address this comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the help @Hangzhi I've gone ahead and applied this suggestion to the PR
…nstrumentation into no-credentials-in-httpurl
Fixes this #2674